package com.chat.api.web.vo;

import com.chat.api.web.po.UserBean;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class UserEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String username = "";
    private String password = "";
    private String name = "";
    private String phone = "";
    private String bunchnumber = "";
    private String confirmPassword = "";
    private String vscode = "";
    private String praise = "";
    private String image = "";
    private String head = "";
    private String email;
    private String noRead = "0";

    public void setBean(UserBean bean){
        Integer praiseI = 0;
        bean.setUsername(username);
        bean.setPassword(password);
        bean.setName(name);
        bean.setPhone(phone);
        bean.setBunchnumber(bunchnumber);
        if (bean.getPraise() != null){
            praiseI = Integer.valueOf(praise);
        }
        bean.setPraise(praiseI);
        bean.setImage(image);
        bean.setHead(head);
        bean.setEmail(email);
    }

    public void setEntity(UserBean bean){
        this.setId(String.valueOf(bean.getId()));
        this.setUsername(bean.getUsername());
//        this.setPassword(bean.getPassword());
        this.setName(bean.getName());
        this.setPhone(bean.getPhone());
        this.setBunchnumber(bean.getBunchnumber());
        this.setPraise(String.valueOf(bean.getPraise()));
//        this.setImage(bean.getImage());
//        this.setHead(bean.getHead());
//        this.setEmail(bean.getEmail());
    }
}
